package com.goldsign.pay.server.zuul;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;

import com.goldsign.pay.server.zuul.filter.SecurityFilter;


/**支持网关路由*/
/**启动类加上注解@EnableZuulProxy它默认加上了@EnableCircuitBreaker和@EnableDiscoveryClient*/
@EnableZuulProxy 
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
public class ZuulServer {
    public static void main(String[] args) {
        SpringApplication.run(ZuulServer.class, args);
    }
    
    
    /**注册自定义过滤器*/
////    @Bean
//    public ErrorFilter errorFilter(){
//      return new ErrorFilter();
//    }
//
//    /**注册自定义过滤器2*/
    @Bean
    public SecurityFilter securityFilter(){
      return new SecurityFilter();
    }
//    
}